package com.xukang.batch.service;

import com.xukang.batch.po.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Mr.NaCl
 * @since 2024/9/26
 */
@Service
public class UserService {

    @Autowired
    private UserRepository userRepository;

    public Integer insert() {
        Integer size = 13;
        for(int i = 0; i < size; i++){
            userRepository.save(new Users(null, "xukang" + i, "123456", i));
        }
      return size;
    }
 public List<Users> findAll() {
        List<Users> users = userRepository.findAll();
        return users;
    }

}
